package com.wang.mybatisdemo.Service;

import com.wang.mybatisdemo.dao.BaseDao;
import com.wang.mybatisdemo.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;

@Service
@Transactional
public class BaseServiceImpl implements BaseService{

    @Autowired
    private BaseDao baseDao;



    @Override
    public void add(String  tableName,Map<String,Object> param) {
        baseDao.add(tableName,param);
    }

    @Override
    public void update(String tableName, Map<String, Object> conditionParam, Map<String, Object> param) {
        baseDao.update(tableName,conditionParam,param);
    }
    @Override
    public void delete(String tableName, Map<String,Object> conditionParam) {
        baseDao.delete(tableName,conditionParam);
    }

    @Override
    public Integer selectCountByParam(String tableName, Map<String, Object> conditionParam) {
        return baseDao.selectCountByParam(tableName,conditionParam);
    }

    @Override
    public Integer selectCountByAll(String tableName) {
        return baseDao.selectCountByAll(tableName);
    }


}
